<template>
  <material-detail :material-id="materialId" />
</template>

<script>
import MaterialDetail from './components/MaterialDetail'

export default {
  name: 'MaterialShow',
  components: {
    MaterialDetail
  },
  data() {
    return {
      materialId: ''
    }
  },
  watch: {
    $route: {
      handler(route) {
        this.materialId = route.params && route.params.id
      },
      immediate: true
    }
  },
  created() {
    this.materialId = this.$route.params.id
  }
}
</script>
